package org.raymond.iworks.study.basic.designpattern.command;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class Client {
    public static void main(String[] args) {
        LightReceiver lightReceiver = new LightReceiver();
        LightOnCommand lightOnCommand = new LightOnCommand(lightReceiver);
        LightOffCommand lightOffCommand = new LightOffCommand(lightReceiver);
        RemoteController remoteController = new RemoteController();

        int lightNo = 0;
        remoteController.setCommand(lightNo, lightOnCommand, lightOffCommand);

        System.out.println("按下开灯按钮");
        remoteController.onButtonPushed(lightNo);
        System.out.println("按下关灯按钮");
        remoteController.offButtonPushed(lightNo);

        System.out.println("按下撤销按钮");
        remoteController.undoButtonPushed();
    }
}
